<div class="usercenter">
	<include file="User/_menu" />
	<div class="content">
		<div class="title">修改密码</div>
		<form method="post">
		<table class="addr">
			<tr><th width="95">新密码：</th><td><input type="password"  name="password" id="pwd" required/></td></tr>
			<tr><th width="95">确认密码：</th><td><input type="password" id="pwd2" required  /></td></tr>
			
			
			<tr><th></th><td class="act">
				<input type="submit" value="保存" id="submit" />
				<input type="button" value="取消" onclick="location.href='{:U('user/index')}'" />
			</td></tr>
		</table>
		</form>
	</div>
</div>
<script>
//失去焦点时验证表单
$("#pwd2").blur(function(){
	if($(this).val() !== $("#pwd").val()){
		$(this).addClass('error');
	}else{
		$(this).removeClass('error');
	}
});
//表单提交时验证表单
$("form").submit(function(){
	if($("#pwd2").val() !== $("#pwd").val()){
		alert('两次输入密码不一致！');
		return false;
	}
});
</script>